
<style type="text/css">
    .layui-table-body{overflow-x:auto;}
    .layui-table-cell{font-size:12px;}
</style>
<table id="dataTable"></table>

<script type="text/html" id="statusTpl">
    <input type="checkbox" name="status" value="{{ d.status }}" lay-skin="switch" lay-filter="switchStatus" lay-text="正常|关闭" {{ d.status == 1 ? 'checked' : '' }} data-href="{:url('status')}?id={{ d.id }}">
</script>
<script type="text/html" title="操作按钮模板" id="buttonTpl">
    {{# if(d.status == 1){ }}
    <a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe-pop"  hisi-data="{width: '1300px', height: '600px', title: '修改'}">审核</a>
    {{# } }}
    <a href="{:url('edit')}?id={{ d.id }}&xx=2" target="_blank" class="layui-btn layui-btn-xs layui-btn-normal">打印</a>
    <a href="{:url('look')}?id={{ d.id }}&type=1" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe-pop"  hisi-data="{width: '900px', height: '600px', title: '查看产品'}">查看</a>
</script>
{include file="system@block/layui" /}
<script id="toolbar" type="text/html">
    <a href="{:url('add')}" class="layui-btn layui-btn-normal layui-btn-sm hisi-iframe-pop" hisi-data="{width: '1300px', height: '650px', title: '添加入库'}">&nbsp;添加入库</a>
</script>
<script type="text/javascript">
    layui.use(['table'], function() {
        var table = layui.table;
        table.render({
            elem: '#dataTable'
            ,url: '{:url()}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: '#toolbar'
            ,defaultToolbar: ['filter']
            ,cols: [[ //表头
                {type:'checkbox'}
                ,{field: 'id',width:70, title: 'ID'}
                ,{field: 'sn', title: '订单号'}
                ,{field: 'admin_id_text', title: '操作员'}
                ,{field: 'shop_name', title: '门店'}
                ,{field: 'warehouse_name', title: '仓库'}
                ,{field: 'out_type_text', title: '入库类型'}
                ,{field: 'bak', title: '备注'}
                ,{field: 'status', title: '状态',templet:function(d){
                    if(d.status == 1){
                        return '待审核';
                    }else if(d.status == 2){
                        return '通过';
                    }else if(d.status == 3){
                        return '作废';
                    }
                }}
                ,{field: 'createtime', title: '创建时间'}
                ,{title: '操作', width: 180, templet: '#buttonTpl'}
            ]]

        });
    });
</script>
